#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    // connect(&m_device, &WidgetDeviceForm::Sig_DeviceVisibilityProtocol, &m_show, &widgetShowControlForm::Sig_DeviceVisibilityProtocol);
    // connect(&m_device, &WidgetDeviceForm::Sig_DeviceGroundWeatherStationProtocol, &m_show, &widgetShowControlForm::Sig_DeviceGroundWeatherStationProtocol);
    // connect(&m_device, &WidgetDeviceForm::Sig_DeviceSolarRadioMeterProtocolNSU, &m_show, &widgetShowControlForm::Sig_DeviceSolarRadioMeterProtocolNSU);
    // connect(&m_device, &WidgetDeviceForm::Sig_DeviceSolarRadioMeterProtocolSTA, &m_show, &widgetShowControlForm::Sig_DeviceSolarRadioMeterProtocolSTA);
    // connect(&m_device, &WidgetDeviceForm::Sig_DeviceSolarRadioMeterProtocolAOD, &m_show, &widgetShowControlForm::Sig_DeviceSolarRadioMeterProtocolAOD);
    // connect(&m_device, &WidgetDeviceForm::Sig_DeviceSolarRadioMeterProtocolATR, &m_show, &widgetShowControlForm::Sig_DeviceSolarRadioMeterProtocolATR);
    // connect(&m_device, &WidgetDeviceForm::Sig_DeviceSolarRadioMeterProtocolLAT, &m_show, &widgetShowControlForm::Sig_DeviceSolarRadioMeterProtocolLAT);
    // connect(&m_device, &WidgetDeviceForm::Sig_DeviceSolarRadioMeterProtocolLON, &m_show, &widgetShowControlForm::Sig_DeviceSolarRadioMeterProtocolLON);


    ui->stackedWidget->insertWidget(enFeatureForm::enSystem, &m_sys);
    ui->stackedWidget->insertWidget(enFeatureForm::enDevice, &m_device);
    ui->stackedWidget->insertWidget(enFeatureForm::enShow, &m_show);
    ui->stackedWidget->insertWidget(enFeatureForm::enData, &m_invertion);
    ui->stackedWidget->insertWidget(enFeatureForm::enLog, &m_logForm);

    connect(ui->pushButton_sys, &QPushButton::clicked, this, [&](){
        ui->stackedWidget->setCurrentIndex(enFeatureForm::enSystem);
    });
    connect(ui->pushButton_control, &QPushButton::clicked, this, [&](){
        ui->stackedWidget->setCurrentIndex(enFeatureForm::enDevice);
    });
    connect(ui->pushButton_show, &QPushButton::clicked, this, [&](){
        ui->stackedWidget->setCurrentIndex(enFeatureForm::enShow);
    });
    connect(ui->pushButton_data, &QPushButton::clicked, this, [&](){
        ui->stackedWidget->setCurrentIndex(enFeatureForm::enData);
    });
    connect(ui->pushButton_log, &QPushButton::clicked, this, [&](){
        ui->stackedWidget->setCurrentIndex(enFeatureForm::enLog);
    });
}

MainWindow::~MainWindow()
{
    delete ui;
}
